package com.custom.jdbc.session;

import java.sql.Connection;

/**
 * @author XiaoBai
 * @since 2024/3/28 15:52
 * 事务隔离级别
 */
public enum DbTxLevel {

    TX_NONE(Connection.TRANSACTION_NONE),
    TX_RU(Connection.TRANSACTION_READ_UNCOMMITTED),
    TX_RC(Connection.TRANSACTION_READ_COMMITTED),
    TX_RR(Connection.TRANSACTION_REPEATABLE_READ),
    TX_SE(Connection.TRANSACTION_SERIALIZABLE),

    ;

    private final int level;

    DbTxLevel(int level) {
        this.level = level;
    }

    public int getLevel() {
        return level;
    }
}
